Skip to content

run optional command after switching audio sink/source - #917

Open
romanstingler wants to merge 1 commit into
MalpenZibo:mainfrom
romanstingler:feat/audio-post-switch-cmd
Open

run optional command after switching audio sink/source#917
romanstingler wants to merge 1 commit into
MalpenZibo:mainfrom
romanstingler:feat/audio-post-switch-cmd

Conversation

@romanstingler

Copy link
Copy Markdown
Collaborator

Closes #892

Allows an optional command to run automatically after switching the audio output or input device in the settings panel. Useful for working around PipeWire/WirePlumber routing issues (e.g. RAOP/HomePod sinks) that require restarting the audio service on switch.

  • Add audio_sink_post_switch_cmd and audio_source_post_switch_cmd to SettingsModuleConfig / AudioSettingsConfig.
  • Track a pending_* flag when ashell issues a default sink/source switch, then run the command once the ServerInfo event confirms the default actually changed. Re-selecting the current default is treated as a no-op and does not trigger the command.
  • Commands run asynchronously (fire-and-forget, bash -c) via crate::utils::launcher::execute_command.
  • Update docs (full_config.md, settings.md).

Example config

[settings]
audio_sink_post_switch_cmd = "systemctl --user restart wireplumber"

@romanstingler
romanstingler force-pushed the feat/audio-post-switch-cmd branch from e54df92 to fa9fed5 Compare August 21, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Idea] Optional command after change of audio or other item(s)

1 participant